package com.whitedust.top50;

/**
 * @author A
 * @since 2025/11/7 12:56
 */

public class Top46 {
    private int s;

    public int mySqrt(int x) {
        s = x;
        return (int) sqrt(x);
    }

    private double sqrt(double x) {
        double res = (x + s / x) / 2;
        if (res == x) return res;
        else return sqrt(res);
    }
}
